let children = []
let addroute = JSON.parse(localStorage.getItem('router'))
if (addroute && addroute.length) {
  function forRouter(routers, child) {
    routers.forEach(item => {
      if (item.children) {
        forRouter(item.children, child)
      } else {
        let Arrs = {
          path: item.path,
          name: item.path.slice(1),
          icon: item.icon,
          routname: item.name,
          component: resolve => require([`@/pages${item.route}.vue`], resolve),
        }
        child.push(Arrs)
      }
    })
  }
  forRouter(addroute, children)
}
export const routers = children
